public class ArrayDemo {
    public static void main (String [] args) {
        String [] bookNames = {"Java 编程", "Python 入门", "数据结构"};
        double [] prices = new double [3];
        prices [0] = 59.9;
        prices [1] = 69.9;
        prices [2] = 49.9;
        for (int i = 0; i < bookNames.length; i++) {
            System.out.println (bookNames [i] + ":" + prices [i] + "元");
        }
        double total = 0;
        for (int i = 0; i < prices.length; i++) {
            total += prices [i];
        }
        System.out.println ("总价:" + total + "元");
    }
}
